//
//  ZiLiaoView.swift
//  RoundCatPlay2
//
//  Created by 姜澎 on 2019/10/30.
//  Copyright © 2019 jiangpeng. All rights reserved.
//

import UIKit

class ZiLiaoView: UIView {
    
    public lazy var UID: UILabel = {
        let l = UILabel()
        l.text = "UID"
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    public lazy var UIDc: UILabel = {
        let l = UILabel()
        l.text = "218456"
        l.font = UIFont.systemFont(ofSize: 14)
        l.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return l
    }()
    
    public lazy var zhiYe: UILabel = {
        let l = UILabel()
        l.text = "职业"
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    public lazy var zhiYec: UILabel = {
        let l = UILabel()
        l.font = UIFont.systemFont(ofSize: 14)
        l.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        l.text = "学生"
        return l
    }()
    
    public lazy var bidthday: UILabel = {
        let l = UILabel()
        l.text = "生日"
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    public lazy var bidthdayC: UILabel = {
        let l = UILabel()
        l.text = "1997-10-25"
        l.font = UIFont.systemFont(ofSize: 14)
        l.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return l
    }()
    
    public lazy var xingQu: UILabel = {
        let l = UILabel()
        l.text = "兴趣"
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    public lazy var xingQuc: UILabel = {
        let l = UILabel()
        l.text = "颜控/LOL/健身"
        l.font = UIFont.systemFont(ofSize: 14)
        l.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return l
    }()
    
    public lazy var line: UIView = {
        let v = UIView()
        v.backgroundColor = UIColor(red: 234/255, green: 234/255, blue: 234/255, alpha: 1)
        return v
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension ZiLiaoView {
    func setUI() {
        addSubview(self.UID)
        addSubview(self.UIDc)
        addSubview(self.zhiYe)
        addSubview(self.zhiYec)
        addSubview(self.xingQu)
        addSubview(self.xingQuc)
        addSubview(self.bidthday)
        addSubview(self.bidthdayC)
        addSubview(self.line)
        
        setUIDFrame()
        setUIDcFrame()
        setzhiYeFrame()
        setzhiYecFrame()
        setxingQuFrame()
        setxingQuCFrame()
        setbidthdayFrame()
        setbidthdayCFrame()
        setBottomLine()
    }
    
    func setUIDFrame() {
        self.UID.snp.makeConstraints { (make) in
            make.top.equalTo(10)
            make.left.equalTo(23)
        }
    }
    
    func setUIDcFrame() {
        self.UIDc.snp.makeConstraints { (make) in
            make.top.equalTo(self.UID.snp_top)
            make.left.equalTo(self.UID.snp_right).offset(10)
        }
    }
    
    func setzhiYeFrame() {
        self.zhiYe.snp.makeConstraints { (make) in
            make.top.equalTo(self.line.snp_bottom).offset(15)
            make.bottom.equalTo(-15)
            make.left.equalTo(self.UID.snp_left)
        }
    }
    
    func setzhiYecFrame() {
        self.zhiYec.snp.makeConstraints { (make) in
            make.top.equalTo(zhiYe.snp_top)
            make.left.equalTo(zhiYe.snp_right).offset(10)
        }
    }
    
    func setxingQuFrame() {
        self.xingQu.snp.makeConstraints { (make) in
            make.top.equalTo(zhiYe.snp_top)
            make.left.equalTo(zhiYec.snp_right).offset(85)
        }
    }
    
    func setxingQuCFrame() {
        self.xingQuc.snp.makeConstraints { (make) in
            make.top.equalTo(xingQu.snp_top)
            make.left.equalTo(xingQu.snp_right).offset(10)
        }
    }
    
    func setbidthdayFrame() {
        self.bidthday.snp.makeConstraints { (make) in
            make.top.equalTo(UIDc.snp_top)
            make.right.equalTo(xingQu.snp_right)
        }
    }
    
    func setbidthdayCFrame() {
        self.bidthdayC.snp.makeConstraints { (make) in
            make.top.equalTo(bidthday.snp_top)
            make.left.equalTo(bidthday.snp_right).offset(10)
        }
    }
    
    func setBottomLine() {
        self.line.snp.makeConstraints { (make) in
            make.left.equalTo(23)
            make.right.equalTo(-18)
            make.height.equalTo(1)
            make.top.equalTo(self.UID.snp_bottom).offset(15)

            
        }
    }
    
    
}
